<template>
  <li class="attentionItem">
    <div class="top">
      <div class="image">
        <img :src="item.u.p" />
      </div>
      <div class="utext">
        <h3>
          {{ item.u.n }}
          <i>LV.{{ item.u.lvl }}</i>
        </h3>
        <h5>
          {{ item.u.followers_count_text }} ·
          <span>{{ item.u.recipes_count_text }}</span>
        </h5>
      </div>
      <h6 class="followbtn">关注</h6>
    </div>
    <div
      class="indexImage"
      :style="{
        height: (item.ph / item.pw) * 100 + 'vw',
      }"
    >
      <img :src="item.p_gif ? item.p_gif : item.img" />
    </div>
    <div class="fav">
      <div class="followuser">
        <span
          v-for="user in item.collect_users"
          :key="user.id"
          :style="{ backgroundImage: 'url(' + user.p + ')' }"
        >
        </span>
      </div>
      <div class="favNum">
        {{ item.collect_count_text }}
      </div>
      <span></span>
      <span></span>
      <span></span>
    </div>
    <div class="text">
      <h1>{{ item.t }}</h1>
    </div>
    <div class="events">
      <ul>
        <li v-for="i in item.events" :key="i.id">
          # {{ i.c }}
        </li>
      </ul>
    </div>
  </li>
</template>

<script>
export default {
  props: ["item"],
};
</script>

<style lang="less" scoped>
.attentionItem {
  // display: flex;
  margin-bottom: 10px;
  .top {
    display: flex;
    align-items: center;
    padding: 10px;
    .image {
      width: 8vw;
      border-radius: 50%;
      overflow: hidden;
      img {
        vertical-align: middle;
      }
    }
    .utext {
      flex: 1;
      margin-left: 10px;
      h3 {
        font-size: 13px;
        i {
          font-size: 12px;
          color: goldenrod;
          margin-left: 10px;
          //   line-height: 30px;
        }
      }
      h5 {
        font-size: 12px;
        color: #aaa;
        transform-origin: left;
        transform: scale(0.9);
      }
    }
    h6 {
      padding: 5px 20px;
      background-color: #ffc533;
      font-size: 12px;
      font-weight: bold;
      border-radius: 20px;
    }
  }
  .indexImage {
    background-color: #e6e6e6;
    overflow: hidden;
    img {
      vertical-align: middle;
    }
  }
  .fav {
    padding: 20px 10px;
    padding-bottom: 10px;
    display: flex;
    align-items: center;
    .followuser {
      display: flex;
      span {
        display: block;
        width: 6vw;
        height: 6vw;
        border-radius: 50%;
        overflow: hidden;
        margin-left: -5px;
        border: 1px solid #fff;
        background-size: 100%;
        background-position: center;
        &:first-child {
          margin-left: 0;
        }
        img {
          vertical-align: top;
        }
      }
    }
    .favNum {
      flex: 1;
      font-size: 12px;
      color: #555;
      margin-left: 10px;
    }
    span {
      width: 6vw;
      height: 6vw;
      background-size: 100%;
      background-position: center;
      margin-left: 15px;
      &:nth-of-type(1) {
        background-image: url("../assets/fav.png");
      }
      &:nth-of-type(2) {
        background-image: url("../assets/apl.png");
      }
      &:nth-of-type(3) {
        background-image: url("../assets/afx.png");
      }
    }
  }
  .text {
    padding: 0 13px 5px 10px;
    h1 {
      font-size: 13px;
      display: -webkit-box;
      overflow: hidden;
      -webkit-box-orient: vertical;
      -webkit-line-clamp: (2);
    }
  }
  .events {
    margin-left: 10px;
    font-size: 12px;
    color: #50969f;
  }
}
</style>